

export function Up(str: string): string {
    return str.replace(/^./, (ch) => ch.toUpperCase());
}

interface Device {
    [index: string]: string | boolean | null
    ua: string
}

export function getDevice(ua: string): Device {
    if (!ua) {
        ua = '';
    }
    const device: Device = {
        ua: ua
    }

    // 网络类型
    if(ua.match(/NetType\/(\w+)/i)) {
        device.netType = RegExp.$1.toUpperCase();
    }
    
    return device;
}
